package com.jmb.apiplatform.api;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Knife4jConfiguration {
    @Bean
    public OpenAPI openAPI(){
        return new OpenAPI()
                .info(new Info()
                        .title("开源测试平台API api接口文档")
                        .description("后端的接口服务")
                        .version("1.0")
                        .contact(new Contact().name("JIN").email("1454404256@qq.com"))
                        .license(new License().name("Apache 2.0").url("http://springdoc.org")
                        ));
    }
    @Bean
    public GroupedOpenApi UserApi() { // 创建了一个api接口的分组
        return GroupedOpenApi.builder()
                .group("user-api") // 分组名称
                .pathsToMatch("/**") // 接口请求路径规则
                .build();
    }
}
